   //main.swift
   //Created by 15180600908 on 2017/9/20
   //Copyright © 2017年 yangze15. All rights reserved.
   print("杨泽")
   import Foundation
   public extension NSString {
    func split(splitStr:NSString)->[NSString] {
        let scanner = Scanner(string: self as String)
        var arr:[NSString] = []
        while (scanner.isAtEnd == false){
            var subStr:NSString? = ""
            scanner.scanUpTo(splitStr as String, into: &subStr)
            arr.append(subStr!)
        }
        return arr
    }
   }
   let str: NSString = "wo shi yang ze"
   print(str.split(splitStr: " "))
   print(str.split(splitStr: " wo "))
   print(str.split(splitStr: " shi "))
   print(str.split(splitStr: " yang "))
   print(str.split(splitStr: " ze "))
